
#include "mainwindow.h"

#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QMainWindow>

#include <screenutil.h>
#include <version.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setApplicationName("android-repo-analyzer");
    a.setApplicationDisplayName("Android 开源项目分析器 - v" PROJECT_VERSION "(" BUILD_DATE ")");
    MainWindow wm;
    wm.show();

    ScreenUtil::moveCenterForCursor(wm);

#ifdef QT_DEBUG
    char* repo = getenv("DEBUG_REPO");
    if (repo) QMetaObject::invokeMethod(&wm, "load", Q_ARG(QString, repo));
#else
    if (argc > 1) {
        QMetaObject::invokeMethod(&wm, "load", Q_ARG(QString, argv[1]));
    }
#endif

    return a.exec();
}
